const path = require('path');

module.exports = {
  entry: {
    app: [
      'babel-polyfill',
      './src/index.js'
    ]
  },
  devServer: {
  	"port" : 8081,
    proxy: {
      '/tree': {
        target: 'http://127.0.0.1:8085',
        changeOrigin: false,
      }
    }
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].bundle.js',
  },
  module: {
    rules: [{
        test: /\.js?$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
           presets: ['env', 'stage-0']
        }
    }]
  },
  optimization: {
     splitChunks: {
       name: 'common'
     }
  }
}
